package edu.pdx.cs.cs542s07.minichess;

public class HumanMoveTester {
	
	static void testHelper(Board board, String move) {
		System.out.println("Before move:\n");
		System.out.println(board);
		System.out.println("Move: " + move + "\n");
		BoardController controller = new BoardController();
		try {
			controller.humanMove(move, board);
		} catch(IllegalMoveException e) {
			e.printStackTrace(System.out);
		}
		System.out.println("After move:\n");
		System.out.println(board);
		System.out.println("-----------------Move ends.\n");
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(":::::::Test one: four legitimate moves.\n");
		Board boardState = new Board();
		testHelper(boardState, "c2-c3");
		testHelper(boardState, "c5-c4");
		testHelper(boardState, "b1-a3");
		testHelper(boardState, "b6-c5");
		System.out.println(":::::::Test one: END\n");
		
		System.out.println(":::::::Test two: one illegitimate move.\n");
		boardState = new Board();
		testHelper(boardState, "cd-qz");
		System.out.println(":::::::Test two: END\n");
		
		System.out.println(":::::::Test three: no piece.\n");
		boardState = new Board();
		testHelper(boardState, "c3-c4");
		System.out.println(":::::::Test three: END\n");
		
		System.out.println(":::::::Test four: wrong color.\n");
		boardState = new Board();
		testHelper(boardState, "c5-c4");
		System.out.println(":::::::Test four: END\n");
		
		System.out.println(":::::::Test five: can't be moved.\n");
		boardState = new Board();
		testHelper(boardState, "c1-b2");
		System.out.println(":::::::Test five: END\n");
		
		System.out.println(":::::::Test six: can't be to that particular square.\n");
		boardState = new Board();
		testHelper(boardState, "c2-b3");
		System.out.println(":::::::Test six: END\n");
		
		
	}

}
